<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://xmlns.jcp.org/xml/ns/javaee"
	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
	id="WebApp_ID" version="3.1">
	
	<display-name>AcquariumWeb</display-name>
	<servlet>
		<servlet-name>AcquariumWeb</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<init-param>
			<param-name>contextConfigLocation</param-name>
			<param-value></param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>AcquariumWeb</servlet-name>
		<url-pattern>/</url-pattern>
	</servlet-mapping>
	
<!-- ============================================================================================================ -->
	
	<filter>
		<filter-name>springSecurityFilterChain</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>springSecurityFilterChain</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	
<!-- ============================================================================================================ -->

	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	<listener>
		<listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
	</listener>
	<listener>
		<listener-class>it.ap.sa.core.authentication.service.SessionListener</listener-class>
    </listener> 
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>classpath:web-context.xml</param-value>
	</context-param>
	
<!-- ============================================================================================================ -->
	
	<filter>
		<filter-name>requestContextFilter</filter-name>
		<filter-class>org.springframework.web.filter.RequestContextFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>requestContextFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	
<!-- ============================================================================================================ -->

	<!-- Missing login -->
	<error-page>
		<error-code>401</error-code>
		<location>/WEB-INF/pages/auth/sessionExpired.jsp</location>
	</error-page>
	
	<!-- Forbidden directory listing -->
	<error-page>
		<error-code>403</error-code>
		<location>/WEB-INF/pages/auth/accessoNegato.jsp</location>
	</error-page>
	
	<!-- Missing resource -->
	<error-page>
		<error-code>404</error-code>
		<location>/WEB-INF/pages/auth/404.jsp</location>
	</error-page>
	
	<!-- Unsupported method allowed -->
	<error-page>
		<error-code>405</error-code>
		<location>/WEB-INF/pages/auth/error.jsp</location>
	</error-page>
	
	 <!-- Uncaught exception -->
	<error-page>
		<error-code>500</error-code>
		<location>/WEB-INF/pages/auth/error.jsp</location>
	</error-page>
	
	<error-page>
		<exception-type>java.lang.Exception</exception-type>
		<location>/WEB-INF/pages/auth/error.jsp</location>
	</error-page>
	
	<error-page>
		<exception-type>java.io.IOException</exception-type>
		<location>/WEB-INF/pages/auth/error.jsp</location>
	</error-page>

	<!-- exception-type related error pages -->
	<error-page>
	    <exception-type>javax.servlet.ServletException</exception-type >
	    <location>/WEB-INF/pages/auth/error.jsp</location>
	</error-page>

	<session-config>
		<session-timeout>30</session-timeout>
	</session-config>
	
	<welcome-file-list>
		<welcome-file>/WEB-INF/pages/login.jsp</welcome-file>
	</welcome-file-list>
</web-app>